<?php
// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// import Joomla view library
jimport('joomla.application.component.view');

class PricerProductsViewCatalog extends JView {

	protected $msg;
	protected $categorySelected;
	protected $categories;
	protected $vendorSelected;
	protected $vendors;
	protected $products;
	protected $orders;
	protected $orderProducts;
	protected $parameters;

	public function display($tpl = null) {

		$this->categorySelected = $this->get('CategorySelected');
		$this->categories = $this->get('Categories');
		$this->vendorSelected = $this->get('VendorSelected');
		$this->vendors = $this->get('Vendors');
		$this->products = $this->get('Products');
		$this->orders = $this->get('Orders');
		$this->orderProducts = $this->get('OrderProducts');
		$this->parameters = $this->get('Parameters');
		$this->msg = $this->get('Msg');

		if (count($errors = $this->get('Errors'))) {
			JError::raiseError(500, implode('<br />', $errors));
			return false;
		}

		parent::display($tpl);
	}

	protected function getDeliveryTime($dtime) {
		switch($dtime) {
			case '0000-00-10 00:00:00' : return "10 дней";
			case '0000-02-00 00:00:00' : return "2 месяца";
			default : return $dtime;
		}
	}
}
